<%
    String path = request.getContextPath();
    String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort()
            + path + "/";
%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE html>
<base href="<%=basePath%>">

<html>
<head>
    <meta charset="utf-8">
    <title>
        阳光成单系统
    </title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="format-detection" content="telephone=no">
    <link rel="stylesheet" href="System/css/x-admin.css" media="all">
    <link rel="stylesheet" href="System/lib/bootstrap/css/bootstrap.css" media="all">
    <link rel="stylesheet" href="System/lib/bootstrap/js/bootstrap.min.js" media="all">

    <link rel="stylesheet" href="System/css/jqpagination.css" />
    <%--        分页样式--%>
    <style>
        #begin,#upper,#lower,#end{
            width: 40px;
            height: 30px;
            font-size: 20px;
        }
        #a{
            width: 200px;
            height: 30px;
            font-size: 18px;
        }
    </style>
</head>
<body style="height:1150px;">
<div class="container-fluid ygyd-wrapper">
    <!--车辆统计-->
    <div class="row">
        <div class="col-sm-6">
            <section class="panel" style="width:1200px; height:490px">
                <div class="panel-heading">车辆统计</div>
                <div class="panel-body">
                    <div class="echarts" id="product" style="width:1120px; height:420px"></div>
<body>
<div class="x-nav">
            <span class="layui-breadcrumb">
              <a><cite>首页</cite></a>
              <a><cite>会员管理</cite></a>
              <a><cite>会员删除</cite></a>
            </span>
    <a class="layui-btn layui-btn-small" style="line-height:1.6em;margin-top:3px;float:right"  href="javascript:location.replace(location.href);" title="刷新"><i class="layui-icon" style="line-height:30px">ဂ</i></a>
</div>
<div class="x-body">
    <form class="layui-form x-center" action="order/selectOrderlike" method="post" style="width:80%">
        <div class="layui-form-pane" style="margin-top: 15px;">
            <div class="layui-form-item">
                <div class="layui-input-inline">

                    <input type="text" name="str"  placeholder="请输入订单编号" autocomplete="off" class="layui-input">
                </div>
            </section>
        </div>
    </div>

</div>
                <div class="layui-input-inline" style="width:80px">
                    <button class="layui-btn"  class="layui-btn"><i class="layui-icon">&#xe615;</i></button>
                </div>
            </div>
        </div>
    </form>
    <xblock><span class="x-right" style="line-height:40px">共有数据：${count} 条</span></xblock>
    <table class="layui-table">
        <thead>
        <tr>
            <th>
                <input type="checkbox" name="" value="">
            </th>
            <th>
                编号
            </th>
            <th>
                订单来源
            </th>
            <th>
                来源地址
            </th>
            <th>
                订单编号
            </th>
            <th>
                运送人
            </th>
            <th>
                接货负责人
            </th>
            <th>
                订单状态
            </th>

            <th>
                操作
            </th>
        </tr>
        </thead>
        <tbody id="tbody">

<script src="System/lib/layui/layui.js" charset="utf-8"></script>
<script src="System/js/index.js"></script>
<script src="System/js/echarts.min.js"></script>
<script src="System/js/echart.js"></script>
<%--产品统计--%>
<script type="text/javascript">
    // 基于准备好的dom，初始化echarts实例
    var myChart = echarts.init(document.getElementById('product'));
        <c:forEach var="order" items="${selectOrders}">
        <tr>
            <td>
                <input type="checkbox" value="${order.orderId}" name="">
            </td>
            <td>
                   ${order.orderId}
            </td>
            <td>
                    ${order.supplier.supplierName}
            </td>
            <td >
                    ${order.orderAddress}
            </td>
            <td >
                    ${order.orderNumber}

    // 指定图表的配置项和数据
    var option = {
        title: {
            text: '车辆信息比例',
            subtext: '仅供参考',
            x: 'center'
        },
        tooltip: {
            trigger: 'item',
            formatter: "{a} <br/>{b} : {c} ({d}%)"
        },
        legend: {
            orient: 'vertical',
            left: 'left',
            data: [
                <c:forEach items="${car}" var="c">
                '${c.car_number}',
                </c:forEach>]
        },
        series: [{
            name: '访问来源',
            type: 'pie',
            radius: '55%',
            center: ['50%', '60%'],
            data: [
                /* { value: 1335, name: '车贷' },
                 { value: 310, name: '房贷' }*/
                <c:forEach items="${car}" var="c">
                {
                    value: '${c.car_number.length()}',
                    name: '${c.car_number}'
                },
                </c:forEach>
            ],
            itemStyle: {
                emphasis: {
                    shadowBlur: 10,
                    shadowOffsetX: 0,
                    shadowColor: 'rgba(0, 0, 0, 0.5)'
                }
            </td>
            <td >
                    ${order.orderPerson}

            </td>
            <td >
                    ${order.employees.employeesName}

            </td>
            <td>
                    ${order.orderState==0?" 待确实":"已确认"}

            </td>

            <td class="td-manage">
                <a style="text-decoration:none" onclick="member_recover(this,${order.orderId})" href="javascript:;" title="确认接货">
                    <i class="layui-icon">&#xe618;</i>
                </a>

            </td>
        </tr>
        </c:forEach>
        </tbody>
    </table>

    <%--    分页--%>
    <div id="wrapper" style="margin-top: -10px;margin-left:480px">
        <div class="pagination">
            <a href="javascript:;" onclick="begin1()"  id="begin" class="first" data-action="first">&laquo;</a>
            <a href="javascript:;" onclick="upper1()"  id="upper" class="previous" data-action="previous">&lsaquo;</a>

            <input type="text" id="a"  readonly="readonly" value="${pageText}"/>
            <input type="hidden" id="a1" readonly="readonly" value="${thisPage}">

            <a href="javascript:;"  onclick="lower1()" id="lower" class="next" data-action="next">&rsaquo;</a>
            <a href="javascript:;" onclick="end1()"  id="end" class="last" data-action="last">&raquo;</a>
        </div>
        <div class="clearfix"></div> <!-- should probably have a shower after that -->
        <div style="text-align:center;clear:both;margin-top:50px">
            <%--    <script src="/gg_bd_ad_720x90.js" type="text/javascript"></script>--%>
            <%--    <script src="/follow.js" type="text/javascript"></script>--%>
        </div>
    </div>

</div>
<script src="System/lib/layui/layui.js" charset="utf-8"></script>
<script src="System/js/x-layui.js" charset="utf-8"></script>
<script>
    layui.use(['laydate','element','laypage','layer'], function(){
        $ = layui.jquery;//jquery
        laydate = layui.laydate;//日期插件
        lement = layui.element();//面包导航
        laypage = layui.laypage;//分页
        layer = layui.layer;//弹出层

        //以上模块根据需要引入

        laypage({
            cont: 'page'
            ,pages: 100
            ,first: 1
            ,last: 100
            ,prev: '<em><</em>'
            ,next: '<em>></em>'
        });

        var start = {
            min: laydate.now()
            ,max: '2099-06-16 23:59:59'
            ,istoday: false
            ,choose: function(datas){
                end.min = datas; //开始日选好后，重置结束日的最小日期
                end.start = datas //将结束日的初始值设定为开始日
            }
        };

        var end = {
            min: laydate.now()
            ,max: '2099-06-16 23:59:59'
            ,istoday: false
            ,choose: function(datas){
                start.max = datas; //结束日选好后，重置开始日的最大日期
            }
        }]
    };

    // 使用刚指定的配置项和数据显示图表。
    myChart.setOption(option);
        document.getElementById('LAY_demorange_s').onclick = function(){
            start.elem = this;
            laydate(start);
        }
        document.getElementById('LAY_demorange_e').onclick = function(){
            end.elem = this
            laydate(end);
        }

    });

    //批量删除提交
    function recoverAll () {
        layer.confirm('确认要批量删除吗？',function(index){
            //捉到所有被选中的，发异步进行恢复
             $.post()
            layer.msg('删除成功', {icon: 1});
        });
    }

    /*用户-恢复*/
    function member_recover(obj,id){
        layer.confirm('确认接货吗？',function(index){
            //发异步删除数据
            $.post("order/updateOrderState",{orderId:id},function (){

            });
            $(obj).parents("tr").remove();
            layer.msg('已接货!',{icon:1,time:1000});
        });
    }

    /*用户-彻底删除(修改状态)*/
    function member_unset(obj,id){
        layer.confirm('彻底删除无法恢复，确认要删除数据吗？',function(index){
            //发异步删除数据
            $.post("order/updateOrderState",{orderId:id},function (){

            });
            $(obj).parents("tr").remove();
            layer.msg('已彻底删除',{icon:1,time:1000});
        });
    }


    //首页
    function begin1(){
        $("#a1").attr("value",1);
        var number=$("#a1").val();
        location.href="order/selectOrder?page="+number;
    }
    //上一页
    function upper1(){
        if(parseInt($("#a1").val())<=1){
            $("#a1").val().attr("value",1);
        }
        $("#a1").attr("value",parseInt($("#a1").val())-1);
            var number=$("#a1").val()



        location.href="order/selectOrder?page="+number;
    }
    //下一页
    function lower1(){
        // 当前页   3  +1   4   3
        if(parseInt($("#a1").val())>=${goodPageMax}){
            $("#a1").val().attr("value",${goodPageMax})
        }
        $("#a1").attr("value",parseInt($("#a1").val())+1);
        var number=$("#a1").val();
        location.href="order/selectOrder?page="+number;
    }
    //尾页
    function end1(){
        $("#a1").attr("value",${goodPageMax});
        var number=$("#a1").val();
        location.href="order/selectOrder?page="+number;
    }
</script>

</body>
</html>